/*
 * @Description: 档案日志管理类型导航
 * @Author: Rfan
 * @Date: 2022-09-19 14:08:51
 * @LastEditTime: 2022-09-19 17:48:28
 */

import { useState } from 'react';
import { Menu, Typography } from 'antd';
import cs from 'classnames';
import classnames from 'classnames/bind';
import { useLogContext } from '../contexts/LogContext';
import type { SelectInfo } from 'rc-menu/lib/interface';
import styles from '../styles/logNav.module.scss';
import { arrToTree } from '@/utils';
import SidebarType from '@/view/logMgt/Log/components/SidebarType';

const cx = classnames.bind(styles);

const PageSidebar = (props: any) => {
  const { className } = props;
  const { logNavList, operateLogTypeList } = useLogContext();
  const items = arrToTree(logNavList.map((item: any) => ({ ...item, key: item.id })));

  return (
    <div className={cs(cx('log-sidebar'), className)}>
      <SidebarType title="业务日志" type="business" items={items} />
      <SidebarType title="操作日志日志" type="operate" items={operateLogTypeList} />
    </div>
  );
};

export default PageSidebar;
